package com.ruoyi.machine.service.impl;


import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.core.domain.machine.EmpEquipment;
import com.ruoyi.common.core.domain.machine.EmpMachine;
import com.ruoyi.machine.mapper.EmpEquipmentMapper;
import com.ruoyi.machine.service.IEmpEquipmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 设备列表Service业务层处理
 *
 * @author 黄字添
 * @date 2023-12-26
 */
@Service
public class EmpEquipmentServiceImpl implements IEmpEquipmentService {
    @Autowired
    private EmpEquipmentMapper empEquipmentMapper;

    /**
     * 查询设备列表
     *
     * @param equipmentID 设备列表主键
     * @return 设备列表
     */
    @Override
    public EmpEquipment selectEmpEquipmentByEquipmentID(Long equipmentID) {
        return empEquipmentMapper.selectEmpEquipmentByEquipmentID(equipmentID);
    }

    /**
     * 查询设备列表列表
     *
     * @param empEquipment 设备列表
     * @return 设备列表
     */
    @Override
    @DataScope(deptAlias = "ee", userAlias = "ee")
    public List<EmpEquipment> selectEmpEquipmentList(EmpEquipment empEquipment) {
        return empEquipmentMapper.selectEmpEquipmentList(empEquipment);
    }
    
    /**
     * 查询未绑定的设备列表列表
     *
     * @param empEquipment 设备列表
     * @return 设备列表
     */
    @Override
    @DataScope(deptAlias = "ee", userAlias = "ee")
    public List<EmpEquipment> selectEmpEquipmentNoUseList(EmpEquipment empEquipment) {
        return empEquipmentMapper.selectEmpEquipmentNoUseList(empEquipment);
    }
    
    /**
     * 查询machine_id_bind和seat_number是否已经被绑定
     *
     * @param empEquipment 设备列表
     * @return 设备列表集合
     */
    @Override
    public EmpEquipment selectEmpEquipmentByMachineIdBindAndSeatNumber(EmpMachine empMachine) {
        return empEquipmentMapper.selectEmpEquipmentByMachineIdBindAndSeatNumber(empMachine);
    }

    /**
     * 新增设备列表
     *
     * @param empEquipment 设备列表
     * @return 结果
     */
    @Override
    public int insertEmpEquipment(EmpEquipment empEquipment) {
        return empEquipmentMapper.insertEmpEquipment(empEquipment);
    }

    /**
     * 修改设备列表
     *
     * @param empEquipment 设备列表
     * @return 结果
     */
    @Override
    public int updateEmpEquipment(EmpEquipment empEquipment) {
        return empEquipmentMapper.updateEmpEquipment(empEquipment);
    }

    /**
     * 批量删除设备列表
     *
     * @param equipmentIDs 需要删除的设备列表主键
     * @return 结果
     */
    @Override
    public int deleteEmpEquipmentByEquipmentIDs(Long[] equipmentIDs) {
        return empEquipmentMapper.deleteEmpEquipmentByEquipmentIDs(equipmentIDs);
    }

    /**
     * 删除设备列表信息
     *
     * @param equipmentID 设备列表主键
     * @return 结果
     */
    @Override
    public int deleteEmpEquipmentByEquipmentID(Long equipmentID) {
        return empEquipmentMapper.deleteEmpEquipmentByEquipmentID(equipmentID);
    }
}
